package lab02.test21;

class Char {
    static String temp = "uadaacava";

    public static int amount(String s, char c) {
        int a = 0;
        for (int i = 0; i < s.length(); i++) {
            if (s.charAt(i) == c) {
                a++;
            }
        }
        return a;
    }

    public static void main(String[] args) {
        System.out.println(temp+"中出现的a字符的次数：");
        System.out.print(amount(temp, 'a'));
    }
}
